const cloud = require('wx-server-sdk')
cloud.init({
  env:'cloud1-0gn0f58bf9089386'
})
const db = cloud.database()
const _ = db.command;
exports.main = async (event, context) => {
  return await db.collection('message').where(_.or([
    {
      _openid:_.eq(event.openID)
    },
    {
      targetid:_.eq(event.openID)
    }
  ]))
  .get()
  // return event
}
